{% extends 'base.html' %}
{% block title %}{% endblock %}
{% load staticfiles %}
{% block custom_bread %}
    <section>
        <div class="wp">
            <ul  class="crumbs">
                <li><a href="/">首页</a>></li>
                <li>教练</li>
            </ul>
        </div>
    </section>
{% endblock %}

{% block content %}
    <section>
	<div class="wp butler_list_box list">
	<div class='left'>
		<div class="butler_list layout">
			<div class="head">
				<ul class="fl tab_header">
					<li {% ifequal sort  '' %}class="active"{% endifequal %}><a href="?sort=">全部</a> </li>
					<li {% ifequal sort  'hot' %}class="active"{% endifequal %}><a href="?sort=hot">人气 &#8595;</a></li>
				</ul>
                <div class="fr butler-num">共<span class="key">{{ count}}</span>人&nbsp;&nbsp;&nbsp;</div>
			</div>
        {% for tea in all_teacher %}


                <dl class="des">
					<dt>
						<a href="{% url 'teacher:detail' tea.user.id %}">
                            <div class="picpic">

                                <img width="100" height="100" class="scrollLoading" src="{{ MEDIA_URL }}{{ tea.user.image }}"/>
                            </div>
                        </a>
					</dt>
					<dd>
						<a href="{% url 'teacher:detail' tea.user.id  %}">
                            <h1>{{ tea.user.username }}<span class="key picbig">金牌教练</span></h1>
                        </a>
						<ul class="cont">
{#							<li>工作年限：<span>{{ teacher.name }}年</span></li>#}
							<li>地点：<span>{{ tea.user.address }}</span></li>
							<li>粉丝：<span>{{ tea.fav_nums }}</span></li>
{#							<li>年龄：<span>{{ teacher.age }}岁</span></li>#}
{#							<li>教学特点：<span>{{ teacher.points }}</span></li>#}
						</ul>
					</dd>
                    <a class="buy buyservice" href="{% url 'teacher:detail' tea.user.id  %}"><br/>查看<br/>详情</a>
                </dl>

        {% endfor %}

		</div>
		<div class="pageturn">

            <ul class="pagelist">
                {% if all_teachers.has_previous %}
                    <li class="long"><a href="?{{ all_teachers.previous_page_number }}">上一页</a></li>
                {% endif %}

                {% for page in all_teachers.pages %}
                    {% if page %}
                        {% ifequal page all_teachers.number %}
                            <li class="active"><a href="?{{ page.querystring }}">{{ page }}</a></li>
                        {% else %}
                            <li><a href="?{{ page.querystring }}" class="page">{{ page }}</a></li>
                        {% endifequal %}
                    {% else %}
                        <li class="none"><a href="">...</a></li>
                    {% endif %}
                {% endfor %}
                {% if all_teachers.has_next %}
                    <li class="long"><a href="?{{ all_teachers.next_page_number.querystring }}">下一页</a></li>
                {% endif %}

            </ul>
        </div>
	</div>
	<div class="right layout">
		<div class="head">讲师排行榜</div>
            {% for hot_teacher in sorted_teacher %}
            <dl class="des">
                <span class="num fl">1</span>
                <a href="/diary/hk_detail/6/">
                    <dt>
                        <img width="50" height="50" class="scrollLoading"  src="{{ MEDIA_URL }}{{ hot_teacher.image }}"/>
                    </dt>
                </a>
                <dd>
                    <a href="/diary/hk_detail/6/">
                        <h1 title="{{ hot_teacher.name }}">{{ hot_teacher.name }}</h1>
                    </a>
                    <p>工作年限：<span>{{ hot_teacher.work_years }}年</span></p>
                </dd>
            </dl>
            {% endfor %}

	</div>
    </div>
</section>
{% endblock %}

